<template>
  <el-menu
    class="el-menu-demo"
    mode="horizontal"
  >
    <span v-for="(item, index) in user_list" :key="index">
    <el-menu-item index="item.id" :to="item.menu_url"><a :href="item.menu_url">{{ item.name }}</a></el-menu-item></span>
  </el-menu>
  <div class="h-6" />
  <el-menu
    class="el-menu-demo"
    mode="horizontal"
    background-color="#545c64"
    text-color="#fff"
    active-text-color="#ffd04b"
  >
  </el-menu>


  <router-view></router-view>
</template>

<script>
export default {
  data() {
    return {
      user_list: "",
      user_id: localStorage.getItem("id"),
    };
  },
  mounted() {
    this.submit();
  },
  methods: {
    submit: function () {
      this.myaxios(this.host + "user/menus/", "get", {
        user_id: this.user_id,
      }).then((data) => {
        console.log(data);
        if (data.code == 200) {
          this.$toast.success(data.msg);
          this.user_list = data.data;
        } else {
          this.$toast.fail(data.msg);
        }
      });
    },
  },
};
</script>

<style>
</style>